/* Copyright: Personal possession of Nguyen Minh Kha
 * Description: User to manage sprites
 * Datetime: 01:20PM 10/12/2011
 * Licencse: free sourece
 * Writer: Nguyen Minh Kha
 */

#ifndef GAMEFRAMEWORK_TEXTURES_MANAGER_H_
#define GAMEFRAMEWORK_TEXTURES_MANAGER_H_

#include <d3dx9.h>

#include "log.h"

class TexturesManager
{

  /* Structure */

public:
  struct TextureNode{
    int id;
    int width;
    int height;
    LPDIRECT3DTEXTURE9 texture;
    struct TextureNode *pNext;
  };

  /* Static Field*/

  //
  // static method
  //

public:
  static TexturesManager* getInstance() {return this_pointer;}

  //
  // static member
  //

private:
  static TexturesManager* this_pointer;

  /* Constructor, destructor */

public:
  TexturesManager(void);
  ~TexturesManager(void);

  /* Method */

public:
  void Add(int id, LPWSTR texture_name, D3DXCOLOR transcolor);
  void AddArray();
  TextureNode* GetTextureById(int id);
  void RemoveAll();
private:
  void Add(TextureNode *node);

  /* Data member */
private:
  TextureNode *texture_head;
};

#endif // GAMEFRAMEWORK_TEXTURES_MANAGER_H_

